/**
 * @file    WebOleInPlaceUIWindow.cpp
 * @brief   
 * @date    2005-03-15 15:55:23
 * @author  GengYong (gengyong@gmail.com)
 *
 */

#include <cassert>
#include "WebOleInplaceUIWindow.h"

using namespace xessage_private;

WebOleInPlaceUIWindow::WebOleInPlaceUIWindow(WebWindowImpl * app):m_appImpl(app), m_refCount(1)
{
	return;
}

WebOleInPlaceUIWindow::~WebOleInPlaceUIWindow()
{
	return;
}

HRESULT	STDMETHODCALLTYPE WebOleInPlaceUIWindow::QueryInterface(REFIID riid, void ** ppvObject)
{
	if (ppvObject == NULL) return E_POINTER;

	if ((riid == IID_IUnknown) || (riid == IID_IOleInPlaceUIWindow))
	{
		this->AddRef();
		*ppvObject = this;
	}
	else
	{
		*ppvObject = 0;
		return E_NOINTERFACE;
	}
	return S_OK;
}

ULONG	STDMETHODCALLTYPE WebOleInPlaceUIWindow::AddRef()
{
	return InterlockedIncrement(&m_refCount);
}

ULONG	STDMETHODCALLTYPE WebOleInPlaceUIWindow::Release()
{
	LONG result = InterlockedDecrement(&m_refCount);
	assert(result >= 0);
	if (result == 0)
	{
		delete this;
	}
	return (ULONG)(result);
}

HRESULT STDMETHODCALLTYPE WebOleInPlaceUIWindow::GetWindow(HWND *phwnd)
{
	return E_NOTIMPL;;
}

HRESULT STDMETHODCALLTYPE WebOleInPlaceUIWindow::ContextSensitiveHelp(BOOL fEnterMode)
{
	return E_NOTIMPL;;
}

HRESULT STDMETHODCALLTYPE WebOleInPlaceUIWindow::GetBorder(LPRECT lprectBorder)
{
	return E_NOTIMPL;;
}

HRESULT STDMETHODCALLTYPE WebOleInPlaceUIWindow::RequestBorderSpace(LPCBORDERWIDTHS pborderwidths)
{
	return E_NOTIMPL;;
}

HRESULT STDMETHODCALLTYPE WebOleInPlaceUIWindow::SetBorderSpace(LPCBORDERWIDTHS pborderwidths)
{
	return E_NOTIMPL;;
}

HRESULT STDMETHODCALLTYPE WebOleInPlaceUIWindow::SetActiveObject(IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
{
	return E_NOTIMPL;;
}
